﻿@using BV.PACS.WEB.Client.Services.Api
@using BV.PACS.WEB.Shared.Models
@using BV.PACS.WEB.Client.Shared.Components
@inherits BV.PACS.WEB.Client.Sources.SourceTrackingPanelCode

<div class="row">

    @if (TrackingObject != null)
    {
        <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
            <DxFormLayoutItem Caption="@Translations.SourceBarcode" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@SourceBarcode"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.SourceRegistrationDate" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxDateEdit @bind-Date="@SourceRegistrationDate"></DxDateEdit>
                </Template>
            </DxFormLayoutItem>

            <DxFormLayoutItem Caption="@Translations.SourceType" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <SourceMaterialTree Data="@SourceTypes"
                                        SelectedItem="SourceTypeSelectedItem"
                                        OnCancel="@SourceTypeCancelled"
                                        OnSelect="@SourceTypeSelected">

                    </SourceMaterialTree>

                </Template>
            </DxFormLayoutItem>
            @if (Templates != null)
            {
                <DxFormLayoutItem Caption="@Translations.SourceTemplateName" ColSpanLg="6" ColSpanMd="12">
                    <Template>

                        <DxComboBox Data="@Templates"
                                    TextFieldName="Name"
                                    NullText="@PacsMessagesTranslations.SelectTemplate"
                                    @bind-SelectedItem="@Template">
                        </DxComboBox>

                    </Template>
                </DxFormLayoutItem>
            }
            <DxFormLayoutItem Caption="@Translations.SourceNote" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@SourceNote"></DxTextBox>
                </Template>
            </DxFormLayoutItem>
            <DxFormLayoutItem Caption="@Translations.SourcePointOfOrigin" ColSpanLg="6" ColSpanMd="12">
                <Template>
                    <DxTextBox @bind-Text="@SourcePointOfOrigin"></DxTextBox>
                </Template>
            </DxFormLayoutItem>

        </DxFormLayout>
    }



</div>